import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/home',
      component: () => import('@/pages/home/index.vue'),
    },
    {
      path: '/hospital',
      component: () => import('@/pages/hospital/index.vue'),
      children: [
        {
          path: 'register',
          component: () => import('@/pages/hospital/c-cpns/Register/index.vue'),
        },
        {
          path: 'detail',
          component: () => import('@/pages/hospital/c-cpns/Detail/index.vue'),
        },
        {
          path: 'notice',
          component: () => import('@/pages/hospital/c-cpns/Notice/index.vue'),
        },
        {
          path: 'close',
          component: () => import('@/pages/hospital/c-cpns/Close/index.vue'),
        },
        {
          path: 'search',
          component: () => import('@/pages/hospital/c-cpns/Search/index.vue'),
        },
      ],
    },
  ],
  //   滚动行为
  scrollBehavior() {
    return {
      left: 0,
      top: 0,
    };
  },
});

export default router;
